<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="Generator" content="ALORK 20150428.01" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

<title><?php echo $this->_var['top_title']; ?></title>

<link rel="shortcut icon" href="favicon.ico" />
<link rel="icon" href="animated_favicon.gif" type="image/gif" />
<link rel="stylesheet" href="./public/my_style.css" />
<link rel="stylesheet" href="./public/style.css" />

<?php echo $this->smarty_insert_scripts(array('files'=>'./../js/jquery.js')); ?>
<?php echo $this->smarty_insert_scripts(array('files'=>'./../js/common.js,./../js/mobile-common.js,')); ?>
<body>
<?php echo $this->fetch('library/user_head.lbi'); ?>


<div class="body">
  <div id="u_login" >
        <form action="user.php" name="recommend_form" id="recommend_form" method="post" >
        
        <div class="input">
            <div class="username">
              <div class="user_b">推荐人</div>   
              <?php if ($this->_var['user']['agent_rank'] == 100): ?>
		          <input type="text" name="recommend_mobile" id="recommend_mobile" placeholder="填写推荐人手机号"  class="text_input" />
		        <?php elseif ($this->_var['user']['agent_rank'] == 1): ?>
		        	<span class="text_input">我是分销商</span>
		        <?php elseif ($this->_var['user']['agent_rank'] == 2): ?>
		        <span class="text_input"><?php echo $this->_var['one_user']['mobile_phone']; ?></span>
		        <?php endif; ?>
            </div>
        </div>

        <input name="act" type="hidden" value="my_recommend_action" />
        <?php if ($this->_var['user']['agent_rank'] == 100): ?>
        <div class="submits" onclick="form_submit()" >提交绑定</div>
        <?php endif; ?>
        </form>

  </div>

</div>

<script type="text/javascript">

function form_submit(){
	var mobile = $("#recommend_mobile").val();
	if ( mobile.length != 11 )
    {
      alert("手机格式错误");
    }
    else
    {
    	 var reg = /^0?1[3|4|5|8][0-9]\d{8}$/;
    	 if (reg.test(mobile)) {
    		 $("#recommend_form").submit();
    	 }else{
    		 alert("手机格式错误");
    	 }
    	
    }
}


  </script>


</body>

</html>
